import request from '@/utils/request'

/**
 * @description 获取已发货订单列表
 * @param {object} data - 请求参数
 * @param {object} data.queryFields - 查询字段
 * @param {string} [data.queryFields.sendNo] - 发货单号
 * @param {number} data.currentPage - 当前页码
 * @param {number} data.pageSize - 每页数量
 * @returns {Promise}
 */
export const fetchGoodSendList = (data) => {
  return request({
    url: '/dealer/pzOrderSendM/selectPzOrderSendMListByCondition',
    method: 'post',
    data,
  })
}

/**
 * @description 作废发货单
 * @param {object} data - 发货单数据，需包含orderSendMId、cancelReason等
 * @returns {Promise}
 */
export const cancelGoodSend = (data) => {
  return request({
    url: '/dealer/pzOrderSendM/cancelPzOrderSendM',
    method: 'post',
    data,
  })
}
